package com.java1234.service;

import java.sql.Connection;
import java.sql.ResultSet;

import com.java1234.dao.IBookDao;
import com.java1234.dao.impl.BookImpl;
import com.java1234.model.Book;

public class BookService {
	private IBookDao bookDao = new BookImpl();

	/**
	 * 图书信息添加
	 * 
	 * @param con
	 * @param book
	 * @throws Exception
	 */
	public void add(Connection con, Book book) throws Exception {
		bookDao.add(con, book);
		//
	}

	/**
	 * 图书信息查询
	 * 
	 * @param con
	 * @param book
	 * @throws Exception
	 */
	public void list(Connection con, Book book) throws Exception {
		bookDao.list(con, book);
	}

	/**
	 * 图书信息删除
	 * 
	 * @param con
	 * @param id
	 * @throws Exception
	 */
	public void delete(Connection con, String id) throws Exception {
		bookDao.delete(con, id);
	}

	/**
	 * 图书信息修改
	 * 
	 * @param con
	 * @param book
	 * @throws Exception
	 */
	public void update(Connection con, Book book) throws Exception {
		bookDao.update(con, book);
	}

	/**
	 * 指定图书类别下是否存在图书
	 * 
	 * @param con
	 * @param bookTypeId
	 * @throws Exception
	 */
	public void existBookByBookTypeId(Connection con, String bookTypeId) throws Exception {
		bookDao.existBookByBookTypeId(con, bookTypeId);
	}
	
}
